import Vue from 'vue';
import Vuex from 'vuex';
Vue.use(Vuex)

export default new Vuex.Store({
    state: {
        // 登录后以下数据可用
        // token:
        // _id: 用户
        // name: 用户
        // code: 用户
        // power: 用户
        // classCode: 用户

        // tableData:教师页面数据


        // 等待数据
        // CurrentClassCode
        //是否登录状态
		isLogined: false,
        isShow:true,
        token: false
    },
    getters: {
        /* doneTodos: state => {
             return state.todos.filter(todo => todo.done)
         }*/


    },
    mutations: {
        changeState(state, json) {
            for (var key in json) {
                state[key] = json[key];
            }
            //state.isLogined = json.status
        },
        setLoginedFn(state,payload){
            state.isLogined = payload.status
            console.log('setLoginedFn')
        },
        setUser(state,payload){
            window.sessionStorage.setItem('isLogined',payload.flag);
            console.log('setUser')
        }
    },
    getters: {
    },
    actions: {
    }
})
